import React, {Component} from "react";
import {connect} from "react-redux";
import sysType from "./sysType";
import Header from "./app/header";
import LeftMenu from "./app/leftMenu";
import '@style/base.less'

@connect((state,props) => ({}))

export default class app extends Component {
    constructor(props,context) {
        super(props);
        console.log(this.props)
        this.state = {
            isLeftMenuMini: false,
            leftMenu:[],
            sysType:sysType.NORMAL,
            userLeftMenu:[],
            isHideLeftMenu:false,
            isHideTopMenu:false
        }
        this.toggleLeftMenu = this.toggleLeftMenu.bind(this)
    }

    toggleLeftMenu = (val) => {
        this.setState({
            isLeftMenuMini:val
        },()=>{
            sessionStorage.setItem("isLeftMenuMini",val)
        })
    }

    render() {
        const {children} = this.props
        return (
            <div>
                <Header isLeftMenuMini={this.props.isLeftMenuMini}/>
                <LeftMenu toggleLeftMenu={this.toggleLeftMenu}/>
                <div className={this.state.isLeftMenuMini ? 'boxed boxed-mini' : 'boxed'}>
                    <div id="content-container" className="content-container">
                        <div id="page-content">
                            {children}
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}
